package algorithm.test;

import algorithm.sort.Student;

public class MaoPaoPaiXu {

    public static void px(Comparable[] a){
        for(int i=a.length-1;i>=0;i--){
            for (int j=0;j<i;j++){
                if (greater(a[j],a[j+1])){
                    exch(a,j,j+1);
                }
            }
        }
    }
    private static boolean greater(Comparable a,Comparable b){
        return a.compareTo(b)>0;

    }

    private static void exch(Comparable[] a,int i,int j){
        Comparable t=a[i];
        a[i]=a[j];
        a[j]=t;
    }

}
